package cn.yto.print.schedule;

import cn.yto.print.utils.SysMonitorUtil;
import lombok.extern.slf4j.Slf4j;
import org.springframework.context.annotation.Configuration;
import org.springframework.scheduling.annotation.EnableScheduling;
import org.springframework.scheduling.annotation.Scheduled;

@Slf4j
@Configuration
@EnableScheduling
public class SpringScheduledTask {

    /**
     * 5分钟执行一次
     */
    @Scheduled(initialDelay = 60 * 1000L, fixedDelay = 5 * 60 * 1000L)
    public void sysMonitorTask() {
        SysMonitorUtil.cpuMemoryMonitor();
    }

}
